package com.zzl.boot.bigevent.mapper;

import com.zzl.boot.bigevent.pojo.user;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface userMapper {
    @Select("select * from user where  user_name=#{userName}")
     user getByUser( String userName);

    @Select("insert into user(user_name,password,user_pic,create_time,update_time)" +
            "values (#{username},#{password},now(),now(),#{pic})")
    void add(String username, String password,String pic);


    @Select("update user " +
            "set nick_name=#{nickname} " +
            ", email=#{email} " +
            ",update_time=now() " +
            "where id=#{id}")
    void updateUserInfo(user user);
    @Select("update user " +
            "set user_pic=#{vatURl} " +
            ",update_time=now() " +
            "where id=#{id}")
    void updateVat(Integer id, String vatURl);
    @Select("update user " +
            "set password=#{newPassword} " +
            ",update_time=now() " +
            "where id=#{id}")
    void updatePwd(Integer id, String newPassword);

    @Select("select * from user where id=#{id}")
    user getById(Integer id);
}
